package com.example.idlefish.MyAccount.pojo

import android.content.*
import android.os.*
import java.io.*
import java.lang.reflect.*

class CommonUtil {
    // 伴生类，相当于静态函数
    companion object{
        fun <T : Serializable?> getSerializable(intent: Intent, name: String, clazz: Class<T>): T
        {
            return if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
                intent.getSerializableExtra(name, clazz)!!
            else
                intent.getSerializableExtra(name) as T
        }
    }

}